/*
 * Copyright 2006-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.martinimix.service.payment;

import net.martinimix.domain.order.Order;
import net.martinimix.domain.order.OrderHeader;
import net.martinimix.domain.payment.Payment;
import net.martinimix.domain.payment.PaymentMethod;

/**
 * Provides an order payment service.
 * 
 * @author Scott Rossillo
 *
 */
public interface PaymentService {

	/**
	 * Authorizes the payments in the given payment method list.
	 * 
	 * @param paymentMethod the <code>PaymentMethod</code>s to authorize
	 * @param order the <code>Order</code> for which to authorized the
	 * given <code>Payments</code>
	 * 
	 */
	public Payment authorizePayment(PaymentMethod paymentMethod, Order order);
	
	/**
	 * Creates a payment for the given order and payment method.
	 * 
	 * @param orderHeader the <code>OrderHeader</code> for the order for
	 * which a <code>Payment</code> should be created
	 * 
	 * @param paymentMethod the <code>PaymentMethod</code> from which to generate
	 * an order <code>Payment</code>
	 * 
	 * @return a <code>Payment</code> for the given <code>orderHeader</code>
	 * and <code>paymentMethod</code>
	 */
	public Payment createPayment(PaymentMethod paymentMethod, OrderHeader orderHeader);
	
}
